import { http } from "@/utils/http";
import { Result } from "@/api/index";

export type LoginResult = {
  username: string;
  roles: Array<string>;
  accessToken: string;
};

export const login = (data?: object) => {
  return http.request<Result<LoginResult>>("post", "/login", { params: data });
};
